<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>数学运算</title>
</head>
<body>
<!--
  三元运算：表达式?"正确":"错误"
  算术运算：+,-,*,/,%
  关系判断：>,<,>=,<=  (gt,lt,ge,le)
  相等判断：==,!=  (eq,ne)
-->
<h2>三元运算符</h2>
<div th:text="${sex eq 1?'男':'女'}"></div>
<div th:text="${sex == 1?'男':'女'}"></div>
<h2>算术运算</h2>
2+5=<span th:text="2+5"></span><br>
5-2=<span th:text="5-2"></span><br>
2*5=<span th:text="5*2"></span><br>
5/2=<span th:text="5/2"></span><br>
5%2=<span th:text="5%2"></span><br>
<h2>关系判断</h2>
5>2为<span th:if="5 gt 2">真</span><br>
5<2为<span th:unless="5 lt 2">假</span><br>
5>=2为<span th:if="5 ge 2">真</span>
5<=2为<span th:unless="5 le 2">假</span>
<h2>相等判断</h2>
5!=2为<span th:if="5 ne 2">真</span><br>
5==2为<span th:unless="5 eq 2">假</span>
</body>
</html>